---
title: "Balancing algorithm report"
output:
  html_document:
    df_print: paged
editor_options:
  chunk_output_type: console
---

```{r,message=FALSE,echo=FALSE}
library(dplyr)
```

```{r,echo=FALSE}
# Supply a "MyData.csv" to the directory,
# where column 1 of csv is the ID
clean <- read.csv("poland_clean.csv")
MyData=clean
MyData=select(MyData,Record.ID,joint,pol,sex,vot)
write.csv(MyData,"MyData.csv",row.names = F)
MyData <- read.csv("MyData.csv")
```

# Python (config = code) 
```{python engine.path="/usr/bin/python3.5",results='hide'}
import sys
sys.path.append('/home/shared/data/balancing/')
import inject_v2
config = "{1: {'degreeHigh':5.2,'noDegreeHigh':43.5,'degreeLow':20,'noDegreeLow':31.3}},{2: {'interest':45.4,'LowInterest':54.6}},{3: {'Male':47.8,'Female':52.5}},{4: {'PO':26.22,'PiS':25.94,'SLD':7.70,'KNP':5.84,'PSL':5.55,'SP':3.25,'EPlus':2.92,'PR':2.58,'Undec':20.00}}"

filename = '/home/fernando/Misc/bjpolFinal/Poland/MyData.csv'

inject_v2.run(config, filename, "/home/fernando/Misc/bjpolFinal/Poland/myBal", 2, 0, 0)
```
